using System;
using System.Collections.Generic;
using System.Text;
/// <summary>
/// Using implement convert data type as string , interger , float ,etc.
/// </summary>
public class Utility
{
    #region Methods Public
    /// <summary>
    /// Convert string to interger
    /// </summary>
    /// <param name="_value">Value string will convert</param>
    /// <returns>Interger value has convert</returns>
    public static int ToInt(string value)
    {
        int result = 0;
        try
        {
            result = int.Parse(value);
        }
        catch
        {
        }
        return result;
    }
    /// <summary>
    /// Convert string to byte
    /// </summary>
    /// <param name="_value">Value string will convert</param>
    /// <returns>Byte value has convert</returns>
    public static byte ToByte(string value)
    {
        byte result = 0;
        try
        {
            result = byte.Parse(value);
        }
        catch
        {
        }
        return result;
    }
    public static bool ToBoolean(string value)
    {
        bool result = true;
        try
        {
            result = bool.Parse(value);
        }
        catch
        {
        }
        return result;
    }
    #endregion
}
